<?php

require '../claroline/inc/claro_init_global.inc.php';
require_once 'C2IPRAT/lib/C2IPRAT.lib.php';

require_once 'lib/conf.php';
require_once 'lib/portfolioNumerique.lib.php';

require_once 'PORTFOL/lib/portfolio.lib.php';
require_once 'PORTFOL/lib/classes/modele.class.php';
require_once 'PORTFOL/lib/classes/grille.class.php';
require_once 'PORTFOL/lib/classes/elementGrille.class.php';
require_once 'PORTFOL/lib/classes/saisie.class.php';

// Classes pour la gestion des documents
include_once('lib/classes/document.class.php');
include_once('lib/classes/documentCompetence.class.php');

$modele = new Modele();

$grille = new Grille();

$element = new ElementGrille();

$saisie = new Saisie();



// Gestion requete AJAX
if ($_POST['fonction'])
{
	foreach ($_POST as $key=>$param)
	{
		$_POST[$key] = utf8_decode($param);
	}
	
	$feedback = call_user_func($_POST['fonction']);
	
	if (is_array($feedback))
	{
		print_r($feedback);
	}
	else
	echo utf8_decode($feedback);
	
	exit;
}
?>
